<template>
  <!-- 活动内容下的tab -->
  <div>
    <div>
      <LazyLoadTab v-model="activeName" :tabMenus="menus"></LazyLoadTab>
    </div>
    <div v-show="false">
      <fjxm ref="fjxm"></fjxm>
    </div>
    <div v-show="false">
      <pjxm ref="pjxm"></pjxm>
    </div>
    <div v-show="false">
      <wxxm ref="wxxm"></wxxm>
    </div>
  </div>
</template>
<script>
import fjxm from './actXM/fjxm';
import pjxm from './actXM/pjxm';
import wxxm from './actXM/wxxm';
export default {
  name: 'Actcontent',
  components: {
    fjxm,
    pjxm,
    wxxm
  },
  props: ['type', 'detaildata'],
  data() {
    return {
      activeName: '维修项目',
      menus: this.changeMenus()
    };
  },
  methods: {
    ceshi(val) {
      this.$refs.fjxm.ceshi('dayin');
      this.$refs.pjxm.ceshi('dayin');
      this.$refs.wxxm.ceshi('dayin');
    },
    changeMenus() {
      let that = this;
      return [
        {
          title: '维修项目',
          path: 'repair/activitiesManage/activitiesManage/actXM/wxxm',
          params: {
            type: that.type,
            detaildata: that.detaildata
          },
          on: {
            changeone(val) {
              that.$emit('changeoneF', val);
            },
            handlewxxmTotal(val) {
              that.$emit('wxxmTotal', val);
            },
            handleDeleted(val) {
              console.log(val, 'shanchu');
              that.$emit('handleDeletedone', val);
            },
            // 接收推送  只推送列表
            syncTablelist(val) {
              console.log(val, '维修项目带给主页面6666666666');
              // if (val.length > 0) {
              //   that.maintainProList = val;
              // }
              for (const item of val) {
                if (!item.LABOUR_INDEX) item.LABOUR_INDEX = item.LABOUR_CODE + '~' + item.UID_HIDDEN;
                if (!item.rowKey || item.rowKey == 'S') item.rowKey = 'A';
              }
              that.menus[1].params.dataList = val;
            },
            refershSfqfInfo(val) {
              console.log('执行刷新结果', val);
              let result = { LABOUR_INDEX: val.LABOUR_INDEX, CHARGE_PARTITION_CODE: val.CHARGE_PARTITION_CODE };
              that.menus[1].params.labourSfqfChangeData = result;
            }
          }
        },
        {
          title: '维修材料',
          path: 'repair/activitiesManage/activitiesManage/actXM/pjxm',
          params: {
            type: that.type,
            detaildata: that.detaildata,
            dataList: [],
            labourSfqfChangeData: null
          },
          on: {
            changetwo(val) {
              that.$emit('changetwoF', val);
            },
            handlepjxmTotal(val) {
              that.$emit('pjxmTotal', val);
            },
            handleDeleted(val) {
              console.log(val, 'shanchu');
              that.$emit('handleDeletedtwo', val);
            }
          }
        },
        {
          title: '附加项目',
          path: 'repair/activitiesManage/activitiesManage/actXM/fjxm',
          params: {
            type: that.type,
            detaildata: that.detaildata
          },
          on: {
            changethree(val) {
              that.$emit('changethreeF', val);
            },
            handlefjxmTotal(val) {
              that.$emit('fjxmTotal', val);
            },
            handleDeleted(val) {
              console.log(val, 'shanchu');
              that.$emit('handleDeletedthree', val);
            }
          }
        }
      ];
    }
  }
};
</script>

<style lang="less"></style>
